import axios from 'axios';
import { req } from './axiosFun';

/**
 * 支付配置信息
 **/
// 支付配置信息-获取支付配置信息列表
export const MachineConfigList = (params) => { return req("post", "/api/MachineConfig/list", params) };
// 支付配置信息-保存支付配置信息
export const MachineConfigSave = (params) => { return req("post", "/api/MachineConfig/save", params) };
// 支付配置信息-删除支付配置信息
export const MachineConfigDelete = (params) => { return axios.delete("/api/MachineConfig/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };

/**
 * 支付配置
 **/
// 支付配置-获取支付配置列表
export const ConfigList = (params) => { return req("post", "/api/Config/list", params) };
// 支付配置-保存支付配置
export const ConfigSave = (params) => { return req("post", "/api/Config/save", params) };
// 支付配置-删除支付配置
export const ConfigDelete = (params) => { return axios.delete("/api/Config/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };

/**
 * 订单管理-交易订单
 **/
// 主机界面
export const OrderList = (params) => { return req("get", "/api/charts/host_all/", params) };
export const OrderListPage = (params) => { return req("get", "/api/charts/host_all/?page=" + params.currentPage + "&limit=" + params.pageSize) };
export const OrderSave = (params) => { return req("put", "/api/charts/host_all/" + params.id + '/', params) };
export const HostTagList = (params) => { return req("get", "/api/charts/host_tag/", params) };
export const HostSourceList = (params) => { return req("get", "/api/charts/host_source/", params) };
export const OrderAdd = (params) => { return req("post", "/api/charts/host_all/", params) };
export const OrderDelete = (params) => { return axios.delete("/api/charts/host_all/" + params + '/').then(res => res.data) };
// export const HostSearch = (params) => { return req("get", "/api/charts/host_all/?host_tag=" + params.payType__icontains + "&host_source=" + params.orderStatus__icontains + "&host_ip=" + params.host_ip__icontains + "&host_name=" + params.host_name__icontains) };
export const HostSearch = (params) => { return req("get", "/api/charts/host_all/?host_tag=" + params.payType__icontains + "&host_source=" + params.orderStatus__icontains + "&search=" + params.host_ip__icontains + params.host_name__icontains) };

// 图标界面
export const HostTagSourcesNum = () => { return req("get", "/api/charts/host_tag_sources_num/num/") };
export const influxList = () => { return req("get", "/api/charts/host_tag_sources_num/influx_info/") };
// export const HostInfluxdbSearch = (params) => { return req("get", "/api/charts/host_tag_sources_num/influx_info/?host_ip=" + params.hostlist__icontains) };

// 交易订单-交易订单退款
export const OrderRefund = (params) => { return req("post", "/api/Order/refund", params) };
